import { axios } from '@/utils/request'

export function selectAll (parameter) {
  return axios({
    url: '/system/user/listAll',
    method: 'get',
    params: parameter
  })
}

export function selectPage (parameter) {
  return axios({
    url: '/system/user/list',
    method: 'get',
    params: parameter
  })
}

export function saveOrUpdate (parameter) {
  return axios({
    url: '/system/user/saveOrUpdate',
    method: 'post',
    data: parameter
  })
}

export function optionselect1 (parameter) {//小程序
  return axios({
    url: '/mini/customer/optionselect',
    method: 'get',
    params: parameter
  })
}

export function statusBtn (parameter) {
  return axios({
    url: '/system/user/status/' + parameter,
    method: 'put'
  })
}

export function del (id) {
  return axios({
    url: '/system/user/' + id,
    method: 'delete'
  })
}

export function getUser (id) {//获取用户详细信息
  return axios({
    url: '/system/user/' + id,
    method: 'get'
  })
}

export function login (parameter) {
  return axios({
    url: '/system/user/userLogin',
    method: 'post',
    params: parameter
  })
}

export function logout () {
  return axios({
    url: '/system/user/logout',
    method: 'post'
  })
}

export function getInfo () {
  return axios({
    url: '/system/user/selectPermission',
    method: 'get'
  })
}